Newer
Older
Import / applications / RocketMan / Source Code / DebugProfiling.h
@John John on 29 Dec 2020 901 bytes bulk import from macbookpro checkouts
/*
 *  DebugProfiling.h
 *  iphone-gl-app
 *
 *  Created by John Ryland on 16/06/09.
 *  Copyright 2009 InvertedLogic. All rights reserved.
 *
 */

#ifndef DEBUG_PROFILING_H
#define DEBUG_PROFILING_H


class DebugProfiling
{
public:
	class AutoEnter {
	public:
		AutoEnter(const char *func);
		~AutoEnter();
	private:
		const char *func;
	};
	AutoEnter enter(const char *func);

/*
	DebugProfiling();
	~DebugProfiling();
	void start();
	void stop();

private:
	bool signal_handler_installed_;
	struct sigaction old_signal_handler_;
	struct itimerval old_timer_value_;
 */
};

/*
-finstrument-functions

void __cyg_profile_func_enter (void *this_fn, void *call_site);
*/

#ifndef DEBUG_PROFILING_DISABLE
#  define profile()				DebugProfiling::AutoEnter autoEnterExit = DebugProfiling::enter(__PRETTY_FUNCTION__)
#else
#  define profile()
#endif // DEBUG_PROFILING_DISABLE


#endif // DEBUG_PROFILING_H